#include "io.h"

void putl(uint32 value, uint8 base)
{
	uint32 val = 1;

	while ((value / val) > base) {
		val *= base;
	}

	while (val) {
		uint8 c = (uint8)(value / val);
		value -= c * val;
		val /= base;

		if (c < 10)
			c += '0';
		else if (c < 16)
			c = (uint8)('a' + c - 10);
		else
			c = 'x';
		putc(c);
	}
}
